# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-harparser
pkgver=0.4
pkgrel=8
pkgdesc="Python HAR Parser Utility"
arch=('any')
license=('MIT')
url="https://github.com/JustusW/harparser"
depends=('python')
makedepends=('python')
source=("$pkgname-$pkgver.tar.gz::https://github.com/JustusW/harparser/archive/$pkgver.tar.gz"
        python310.patch)
sha512sums=('1aef9ae75b9446d487310a2e4ae4ee8a2aff10c022f68c316307335a5df4346defd73e0d12d0bd4d1a08eeabc90ade9f8d043ee981467bb4fe633184e9f815d9'
            '140b50cd901f952b11caefc3d002a82e75f958da7ba2e782e53c7d0e32b40c23750686954aa7e5554443a602191d4b0fade559e9633226e64dbc5ae267d725c5')

prepare() {
  cd "$srcdir"/harparser-$pkgver
  patch -Np1 -i ../python310.patch
}

build() {
  cd "$srcdir"/harparser-$pkgver
  python setup.py build
}

check() {
  cd "$srcdir"/harparser-$pkgver
  python -m unittest test.log
}

package_python-harparser() {
  cd harparser-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
}
